package service

import (
	"context"
	"git.internal.yunify.com/benchmark/benchmark/pkg/util/pbutil"

	"git.internal.yunify.com/huangyingjun/qingbilling-gateway/api/generate/pb"
	"git.internal.yunify.com/huangyingjun/qingbilling-gateway/internal/apps/cooperate/app/controler"
	"git.internal.yunify.com/huangyingjun/qingbilling-gateway/internal/constants"
)

type NewBillingGatewayService struct {
	pb.UnsafeNewBillingGatewayManagerServer
}

func (n NewBillingGatewayService) GetVodResourcePkgTypes(ctx context.Context, request *pb.VodGetResourcePkgTypesRequest) (*pb.VodGetResourcePkgTypesResponse, error) {
	C := new(pb.VodGetResourcePkgTypesResponse)
	type T struct {
		Types []constants.S `json:"types"`
	}
	var t T
	t.Types = controler.ResourcePkg{}.GetResourcePkgTypes()
	err := pbutil.Encode(t, C)
	if err != nil {
		return nil, err
	}
	return C, nil
}

func (n NewBillingGatewayService) GetVodResourcePkg(ctx context.Context, request *pb.VodGetResourcePkgRequest) (*pb.VodGetResourcePkgResponse, error) {
	return &pb.VodGetResourcePkgResponse{
		Type:   "1111",
		Region: "222222",
	}, nil

}
